package com.gsoe.auth.mapper;

import com.gsoe.auth.po.Power;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author xiaoma
 * @since 2024-11-11
 */
public interface PowerMapper extends BaseMapper<Power> {

    @Select("select p.id as id,p.power_name as powerName from power as p inner join user.role_power rp on p.id = rp.power_id where rp.role_id=#{roleId}")
    List<Power> getRolePermission(@Param("roleId") Long roleId);
}
